<?php
if(!defined('BASEPATH'))
    exit('No direct script access allowed');
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of masterrekening_model
 *
 * @author miyzan
 */
class biayasiswa_model extends MY_MODEL{
    //put your code here
    
    function __construct() {
        parent::__construct();
        // $this->load->database();
    }
    
    function get_rows($search="",$start,$limit) {
        $sql_search="";
        if ($search != "") {
            $sql_search = "(lower(nis) LIKE '" . strtolower($search) . "%' or lower(nama) LIKE '%" . strtolower($search) . "%' 
                 or lower(kelas) LIKE '" . strtolower($search) . "%'  or lower(tahun_ajaran) LIKE '" . strtolower($search) . "%'
                )";
//            $this->db->where($sql_search, NULL);
        }
        $select="id,nis,nama,kd_kelas,kelas,id_th_ajaran,tahun_ajaran,kd_biaya,biaya,biaya_dasar,biaya_dikenakan,tgl_entri,id_user,fgroup";
        $order=array("nis,tahun_ajaran,kd_biaya", "asc");     
        $table="v_biaya_siswa";
        
        $results = $this->get_rows_paging($sql_search,$start,$limit,$table,$select,$order);
        return $results;       
        
    }  
    
    function get_rows_entry($nis="",$th="") {        
        $sql_search = "nis = '$nis' and id_th_ajaran='$th'";        
        $select="nis,id_th_ajaran,kd_biaya,biaya,biaya_dasar,biaya_dikenakan";
        $order=array("nis,id_th_ajaran", "asc");     
        $table="v_biaya_siswa";
        
        $results = $this->get_rows_table($sql_search, $table, $select, $order);
        return $results;       
        
    }  
    
    function get_rows_all() {
        $sql_search="";        
        $select="*";
        $order=array("nis,id_th_ajaran", "asc");     
        $table="v_biaya_siswa";
        
        $results = $this->get_rows_table($sql_search, $table, $select, $order);
        return $results;       
        
    }  
    function get_rows_combo() {
        $sql_search="";        
        $select="*";
        $order=array("nis,id_th_ajaran", "asc");     
        $table="v_biaya_siswa";
        
        $results = $this->get_rows_table($sql_search, $table, $select, $order);
        return $results;       
        
    }  
}

?>
